﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BrnMall.Sdk.WeiXin.Domain.card
{
    /// <summary>
    /// 小微商户进件申请
    /// </summary>
    public class SmallStoreRequest
    {
        #region 必填
        /// <summary>
        /// 固定版本号为3.0
        /// </summary>
        public string version { get; set; } = "3.0";
        /// <summary>
        /// 平台证书序列号
        /// </summary>
        public string cert_sn { get; set; }
        /// <summary>
        /// 服务商的商户号
        /// </summary>
        public string mch_id { get; set; }
        /// <summary>
        /// 随机字符串
        /// </summary>
        public string nonce_str { get; set; }
        /// <summary>
        /// 签名类型，仅支持HMAC-SHA256 
        /// </summary>
        public string sign_type { get; set; }
        /// <summary>
        /// 签名
        /// </summary>
        public string sign { get; set; }
        /// <summary>
        /// 业务申请编号(小微商户的唯一标识，由服务商指定)
        /// </summary>
        public string business_code { get; set; }
        /// <summary>
        /// 身份证正面照
        /// </summary>
        public string id_card_copy { get; set; }
        /// <summary>
        /// 身份证反面照
        /// </summary>
        public string id_card_national { get; set; }
        /// <summary>
        /// 身份证姓名
        /// </summary>
        public string id_card_name { get; set; }
        /// <summary>
        /// 身份证号码
        /// </summary>
        public string id_card_number { get; set; }
        /// <summary>
        /// 身份证有效期
        /// </summary>
        public string id_card_valid_time { get; set; }
        /// <summary>
        /// 开户名称
        /// </summary>
        public string account_name { get; set; }
        /// <summary>
        /// 开户银行
        /// </summary>
        public string account_bank { get; set; }
        /// <summary>
        /// 开户银行省市编码
        /// </summary>
        public string bank_address_code { get; set; }
        /// <summary>
        /// 银行账号
        /// </summary>
        public string account_number { get; set; }
        /// <summary>
        /// 商户简称,最多16个汉字长度
        /// </summary>
        public string merchant_shortname { get; set; }
        /// <summary>
        /// 门店名称
        /// </summary>
        public string store_name { get; set; }
        /// <summary>
        /// 门店省市编码
        /// </summary>
        public string store_address_code { get; set; }
        /// <summary>
        /// 门店街道名称
        /// </summary>
        public string store_street { get; set; }
        /// <summary>
        /// 门店门口照片
        /// </summary>
        public string store_entrance_pic { get; set; }
        /// <summary>
        /// 店内环境照片
        /// </summary>
        public string indoor_pic { get; set; }
        /// <summary>
        /// 客服电话
        /// </summary>
        public string service_phone { get; set; }
        /// <summary>
        /// 售卖商品/提供服务描述(填写以下描述之一：餐饮、线下零售、居民生活服务、休闲娱乐、交通出行、其他)
        /// </summary>
        public string product_desc { get; set; }
        /// <summary>
        /// 费率
        /// </summary>
        public string rate { get; set; }

        /// <summary>
        /// 联系人姓名(和身份证姓名一致,需加密处理)
        /// </summary>
        public string contact { get; set; }
        /// <summary>
        /// 手机号码(需加密处理)
        /// </summary>
        public string contact_phone { get; set; }
        #endregion

        #region 选填
        /// <summary>
        /// 开户银行全称（含支行）
        /// </summary>
        public string bank_name { get; set; } = "";
        /// <summary>
        /// 门店经度
        /// </summary>
        public string store_longitude { get; set; } = "";
        /// <summary>
        /// 门店纬度
        /// </summary>
        public string store_latitude { get; set; } = "";
        /// <summary>
        /// 经营场地证明图片
        /// </summary>
        public string address_certification { get; set; } = "";
        /// <summary>
        /// 补充说明
        /// </summary>
        public string business_addition_desc { get; set; } = "";
        /// <summary>
        /// 补充材料（最多上传5张照片，格式：["123","456"]）
        /// </summary>
        public string business_addition_pics { get; set; } = "";
        /// <summary>
        /// 联系邮箱
        /// </summary>
        public string contact_email { get; set; } = "";
        #endregion
    }

    public class SmallStoreResponse
    {
        public string return_code { get; set; }
        public string return_msg { get; set; }

        #region 正常才返回
        public string nonce_str { get; set; }
        public string sign{ get; set; }
        public string result_code { get; set; }
        #endregion
    }

    public class JsonList<T>
    {
        public List<T> data;
    }

    /// <summary>
    /// 服务商平台证书
    /// </summary>
    public class Certificates
    {
        /// <summary>
        /// 证书序列号
        /// </summary>
        public string serial_no { get; set; }
        public string effective_time { get; set; }
        public string expire_time { get; set; }
        public EncryptCertificates encrypt_certificate { get; set; }
    }
    /// <summary>
    /// 加密的平台证书信息
    /// </summary>
    public class EncryptCertificates
    {
        public string algorithm { get; set; }
        public string nonce { get; set; }
        public string associated_data { get; set; }
        public string ciphertext { get; set; }
    }
}
